Media can be provided to end users over dedicated networks such as cable networks and over multi-purpose networks such as Internet Protocol compliant networks. This provision of media over multi-purpose networks requires an encapsulation of media streams such as MPEG compliant Multiple Program Transport Streams and Single Program Transport Streams within non-video frames or packets such as UDP or RTP frames. The Multiple Program Transport Stream (MPTS) and the Single Program Transport Stream (SPTP) are complex data structures.
MPEG transport streams (either SPTS or MPTS) are generated by a complex process that starts by generating (or receiving) elementary streams such as control data elementary stream, video elementary stream and audio elementary stream. Video and audio elementary streams include multiple access units (AU) that are the fundamental unit of encoding. An elementary stream is converted to a sequence of packetized elementary stream (PES) packets. A video PES packet includes video payload as well as a PES header. An audio PES packet includes audio payload as well as a PES header. The PES header includes, among other things, a presentation time stamp (PTS) and a decode time stamp (DTS) that indicate when the PES packet should be presented and decoded. Each PES packet is broken into fixed sized transport packets (TPs). A Transport packet includes a TP header and a TP payload. The TP header includes a packet identifier (PID) that identifies the elementary stream associated with the TP. The TP header includes an adaptation field that can indicate that the TP header is followed by additional metadata. This additional metadata includes a program clock reference (PCR) field, a discontinuity indicator and the like. The PCR is used for synchronizing the encoding, decoding, transmission and reception of the TPs.
When a SPTS is transmitted over a multi-purpose network, multiple TPs can be included within a single data packet. Typically up to seven TPs are included within a single UDP packet.
Advertisements can be inserted into a transport stream by a splicing process. These advertisements can be broadcast to multiple end users although addressable (targeted) advertisement can be more beneficial to the advertised services or products.
Elementary stream splicing involves extracting TPs from data packets and reconstructing PES packets from the extracted TPs, processing the PES packet headers (including, for example, altering (re-stamping) PTSs, DTSs and the like, packetizing the PES packets in TPs and packetizing the TPs in data packets). Accordingly, elementary stream splicing is a complex task and requires substantial processing resources.
Elementary stream splicing can also be difficult (if not impossible) to implement when the STPS is encrypted. If the TP payload is encrypted the alteration of DTS and PTS requires decrypting the TP. A prior art method is illustrated in U.S. Pat. No. 7,027,516 of Anderson et al., which is incorporated herein by reference.
There is a need to provide systems and methods that can efficiently perform splicing on encrypted and on non-encrypted (clear) streams.